import * as types from '../types'
import config from '@/config'

const mutations = {
  [types.LOADING_HIDE] (state, data) {
    state.siteInit = true
  },

  [types.FETCH_SITE] (state, data) {
    state.theme = Object.assign(config.color, { 'brand-primary': data.colors[0] })
    state.siteInfo = data.profile
    state.siteInit = true
  },
}

export default mutations

// 路由信息的获取方式 (路由信息已经同步到store)
// state.route.path   // current path (string)
// state.route.params // current params (object)
// state.route.query  // current query (object)
